
;; Read in the tables
t1 = read_mrt('./ancillary/RomanDuval_2009_Table1.mrt')
t2 = read_mrt('./ancillary/RomanDuval_2010_Table1.mrt')

;; Find where the two tables overlap
ind1 = where_array(t1.id, t2.name, n1)
ind2 = where_array(t2.name, t1.id, n2)

;; Do a bunch of manipulation to put the overlapping sets in the same order
ind1 = ind1[uniq(ind1,sort(ind1))]
ind2 = ind2[uniq(ind2,sort(ind2))]

t1 = t1[ind2]
t2 = t2[ind1]

t1 = t1[sort(t1.glon)]
t2 = t2[sort(t2.glon)]

;;================================================================
;; Analyze!


;; Believe the 2010 DELV (t2.delv)
help,t1,/str
help,t2,/str



omega = !dpi * t2.r*t2.r / t1.dis/t1.dis/1.d6
theta = t2.r / t1.dis / 1.d3



dsvd = 1.d / theta / (t2.sigma / 100.d) * (t2.delv*t2.delv/0.7d/0.7d) / 1.d3

cgPlot,t1.dis,dsvd,psym=16,symsize=0.4,xtit='KDIST (2009)',$
       ytit='D!dSVD!n Heyer',yr=[0,50]
one2one,color='blue'


plothist,alog10(dsvd/t1.dis),bin=0.05,xa,ya,xst=5
print,!x.crange
vline,0,color='red'
yf = mpfitpeak(xa,ya,A,nterms=3)
cgOplot,xa,yf,color='blue',thick=3
cgAxis,xaxis=0,xtit='D!dSVD!n / KDIST',xr=10^!x.crange,/save,$
       xtickformat='exponent10',/xst,/xlog
cgAxis,xaxis=1,/xst,xtickformat='blank_axis'

END
